package main

import "fmt"

func main() {
	// newlyEarnedPoint := calculateLoyaltyPoints(9.5)
	// var newlyEarnedPoint = calculateLoyaltyPoints(9.5)
	totalPoints := 120
	var newlyEarnedPoint int = calculateLoyaltyPoints(9.3)
	fmt.Println("Earned points today:", newlyEarnedPoint)

	// totalPoints = totalPoints + newlyEarnedPoint

	totalPoints = updateTotalPoints(totalPoints, newlyEarnedPoint)
	fmt.Println("Updated loyalty points", totalPoints)
}

func calculateLoyaltyPoints(amountSpent float64) int {
	loyaltyPoints := int(amountSpent * 2)
	// fmt.Println(loyaltyPoints)

	return loyaltyPoints
}

func updateTotalPoints(currentPoints int, newPoints int) int {
	return currentPoints + newPoints
}
